@include('Admin.public.head')
<body>
@include('Admin.public.menu')
<!-- 引入样式 -->
<div class=" admin-content" id="app">
    <div class="daohang">

    </div>
    <!--充值模态框-->
    <div class="admin-biaogelist">
        <div class="listbiaoti am-cf">
            <ul class="am-icon-yen">分红记录</ul>
            <dl class="am-icon-home" style="float: right;">当前位置： 首页 > <a href="#">分红记录</a></dl>
            <!--这里打开的是新页面-->
        </div>
        <div class="admin-biaogelist">
            <div class="listbiaoti am-cf">
                <ul class="am-icon-yen">分红记录</ul>
                <dl class="am-icon-home" style="float: right;">当前位置： 首页 > <a href="#">分红记录</a></dl>
                <!--这里打开的是新页面-->
            </div>
            <div class="am-btn-toolbars am-btn-toolbar am-kg am-cf">
                <ul>
                    

                    <li>
                        <div class="block">
                            <el-date-picker
                                    v-model="keyword.time"
                                    type="datetimerange"
                                    value-format="yyyy-MM-dd HH:mm:ss"
                                    range-separator="~"
                                    start-placeholder="开始日期"
                                    end-placeholder="结束日期">
                            </el-date-picker>
                        </div>
                    </li>

                   
                    <li>
                        <el-button type="primary" v-on:click="changeClick()">搜索</el-button>
                    </li>
                    {{--<li> <el-button type="success" ><a href="/admin/members/exportUser">导出</a></el-button></li>--}}
                    <li> <el-button type="success" v-on:click="exportDetail()">导出</el-button></li>
                    <li> <el-button type="danger" v-on:click="resetOrder()">重置</el-button></li>
                </ul>
            </div>

        <form class="am-form am-g">
            <table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped">
                <thead>
                <tr class="am-success">
                    <th>分红单号</th>
                    <th>分红金额/人</th>
                    <th>分红总额</th>
                    <th>分红人数</th>
                    <th>分红备注</th>
                    <th>分红时间</th>
                </tr>
                </thead>
                <tbody>
                <tr v-for="val,index in TransferList">
                    <td>@{{ val.ordersn }}</td>
					<td>@{{ val.money }}</td>
                    <td>@{{ val.total_money }}</td>
                    <td>@{{ val.number }}</td>
                    <td>@{{ val.name }}</td>
                    <td>@{{ val.time }}</td>
                </tr>
                </tbody>
            </table>
            <!--分页-->
            <ul class="am-pagination am-fr">
                <div class="block">
                    <el-pagination
                            background
                            :page-size="PagesData.per_page"
                            :current-page = "PagesData.current_page"
                            layout="total , prev, pager, next"
                            :total="PagesData.total"
                            @prev-click="changeClick"
                            @next-click="changeClick"
                            @current-change="changeClick">
                        >
                    </el-pagination>
                </div>
            </ul>
			<!-- <div>
				总参与积分:<span class="am-badge am-badge-danger am-radius">@{{ joinTotal }}&nbsp;&nbsp;&nbsp;&nbsp;</span>
				总分享积分:<span class="am-badge am-badge-danger am-radius">@{{ shareTotal }}</span>
			</div> -->
        </form>

        <script type="text/javascript">

        </script>
        <script>
            var app = new Vue({
                el:"#app",
                data: {
                    TransferList : [],//转账列表
                    PagesData:[],//分页
                    options: [{
                        value: 1,
                        label: '电子积分 '
                    },{
                        value: 2,
                        label: '奖励积分'
                    }],

                    pickerOptions2: {
                        shortcuts: [{
                            text: '最近一周',
                            onClick(picker) {
                                const end = new Date();
                                const start = new Date();
                                start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                                picker.$emit('pick', [start, end]);
                            }
                        }, {
                            text: '最近一个月',
                            onClick(picker) {
                                const end = new Date();
                                const start = new Date();
                                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                                picker.$emit('pick', [start, end]);
                            }
                        }, {
                            text: '最近三个月',
                            onClick(picker) {
                                const end = new Date();
                                const start = new Date();
                                start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                                picker.$emit('pick', [start, end]);
                            }
                        }]
                    },
                    Transaction : [],//交易列表
                    PagesData:[],//分页
                    pase:'',
                    keyword:{ //关键字搜索
                        type:'',
                        time:'',
                        keyword:'',
                    },
					joinTotal:'',
					shareTotal:''
                },
                //事件
                methods: {
                    //选择当前页
                    changeClick:function(e){
                        var rico = this
                        $.get("/admin/finance/getPartnerRecord",{'_token':'{{csrf_token()}}',page:e,keyword:app.keyword},function (res) {
                            if(res.code){
                                app.TransferList = res.data.data
                                app.PagesData = res.data
								app.joinTotal = res.joinTotal
								app.shareTotal = res.shareTotal
                            } else {
                                layer.msg(res.data);
                            }
                        });
                    },

                    initialize:function () {
                        var rico = this
                        //用户列表
                        $.get("/admin/finance/getPartnerRecord",{'_token':'{{csrf_token()}}'},function (res) {
                            if(res.code){
                                app.TransferList = res.data.data
                                app.PagesData = res.data
								app.joinTotal = res.joinTotal
								app.shareTotal = res.shareTotal
                                console.log(  app.PagesData);
                            } else {
                                layer.msg(res.data);
                            }
                        });
                    },
                    //重置
                    resetOrder:function(){
                        location.reload();
                    },
                    //导出
                    exportDetail:function(){
                        location.href="/admin/finance/exportDetail?type="+app.keyword.type+'&time='+app.keyword.time+'&keyword='+app.keyword.keyword+'&ClickType=4';
                    }
                },
                //自动执行
                mounted: function () {
                    this.initialize();
                },
            })
        </script>


@include('Admin.public.foot')